<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商铺注册信息管理</title>
    <script src="../js/vue.js" type="text/javascript"></script>
    <script src="../js/jquery-1.12.4.js" type="text/javascript"></script>
    <script src="../js/axios.min.js" type="text/javascript"></script>
    <link href="../css/storeRegister.css" type="text/css" rel="stylesheet"/>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
    <div id="app">


        <el-select v-model="stateId" placeholder="请选择注册信息状态" @change="findByState">
            <el-option
                    v-for="x in registerStates"
                    :key="x.value"
                    :label="x.label"
                    :value="x.value">
            </el-option>
        </el-select>

        <el-date-picker
                v-model="startTime"
                type="date"
                placeholder="选择开始日期"
                @change="getByTime">
        </el-date-picker>

        <el-date-picker
                v-model="endTime"
                type="date"
                placeholder="选择结束日期"
                @change="getByTime">
        </el-date-picker>

        <el-button @click="remakeQuery">重置查询</el-button>

        <el-table
                :data="storeRegisterList.list"
                style="width: 1500px">
            <el-table-column
                    prop="storeRegisterStoreName"
                    label="商铺名称"
                    width="200"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="storeRegisterAddress"
                    label="地址"
                    width="150"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="storeRegisterPhone"
                    label="联系电话"
                    width="150"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="storeRegisterLinkMan"
                    label="联系人"
                    width="80"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="state"
                    label="申请状态"
                    width="80"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="storeRegisterCreateDate"
                    label="创建日期"
                    width="200"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="storeRegisterRemarks"
                    label="备注"
                    width="200"
                    align="center">
            </el-table-column>
            <el-table-column
                    label="操作"
                    width="200"
                    align="center">
                <template slot-scope="scope">
                    <el-button @click="viewDetail(scope.row)" type="text" size="small">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>

        <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="storeRegisterList.pageIndex"
                    :page-sizes="[3, 5, 8, 10]"
                    :page-size="storeRegisterList.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="storeRegisterList.total">
        </el-pagination>

            <el-dialog
                title="商铺注册详情"
                :visible.sync="showDetailWindow"
                width="80%"
                :before-close="handleClose">
            <el-descriptions :title="'注册编号:'+storeRegisterDetail.storeRegisterId" border>
                <el-descriptions-item label="商铺名称">{{storeRegisterDetail.storeRegisterStoreName}}</el-descriptions-item>
                <el-descriptions-item label="地址">{{storeRegisterDetail.storeRegisterAddress}}</el-descriptions-item>
                <el-descriptions-item label="联系电话">{{storeRegisterDetail.storeRegisterPhone}}</el-descriptions-item>
                <el-descriptions-item label="联系人">{{storeRegisterDetail.storeRegisterLinkMan}}</el-descriptions-item>
                <el-descriptions-item label="营业执照">{{storeRegisterDetail.storeRegisterLicense}}</el-descriptions-item>
                <el-descriptions-item label="餐饮许可证">{{storeRegisterDetail.storeRegisterPermit}}</el-descriptions-item>
                <el-descriptions-item label="注册申请状态">
                    <el-tag v-if="storeRegisterDetail.storeRegisterStatusName=='待审核'">{{storeRegisterDetail.storeRegisterStatusName}}</el-tag>
                    <el-tag v-if="storeRegisterDetail.storeRegisterStatusName=='审核通过'" type="success">{{storeRegisterDetail.storeRegisterStatusName}}</el-tag>
                    <el-tag v-if="storeRegisterDetail.storeRegisterStatusName=='审核不通过'" type="danger">{{storeRegisterDetail.storeRegisterStatusName}}</el-tag>
                    <el-tag v-if="storeRegisterDetail.storeRegisterStatusName=='取消审核'" type="info">{{storeRegisterDetail.storeRegisterStatusName}}</el-tag>
                </el-descriptions-item>
                <el-descriptions-item label="驳回原因" v-if="storeRegisterDetail.storeRegisterStatusName=='审核不通过'">{{storeRegisterDetail.storeRegisterRejectReason}}</el-descriptions-item>
                <el-descriptions-item label="更新人">{{storeRegisterDetail.storeRegisterUpdateUser}}</el-descriptions-item>
                <el-descriptions-item label="更新时间">{{storeRegisterDetail.storeRegisterUpdateDate}}</el-descriptions-item>
                <el-descriptions-item label="创建人">{{storeRegisterDetail.storeRegisterCreateUser}}</el-descriptions-item>
                <el-descriptions-item label="创建日期">{{storeRegisterDetail.storeRegisterCreateDate}}</el-descriptions-item>
            </el-descriptions>
                <h3>附件：</h3>
                <el-image v-for="x in storeRegisterDetail.attachment" :key="x" :src="x"></el-image>


            <span slot="footer" class="dialog-footer">

            <el-button v-if="storeRegisterDetail.storeRegisterStatusName=='待审核'" @click="passRegister" type="success">审核通过</el-button>
            <el-button v-if="storeRegisterDetail.storeRegisterStatusName=='待审核'" @click="showRejectRegister=true" type="danger">驳回</el-button>
            <el-button  @click="showDetailWindow = false">取 消</el-button>
            </span>
        </el-dialog>


        <el-dialog
                title="提示"
                :visible.sync="showRejectRegister"
                width="30%"
                :before-close="handleClose2">
            <el-input
                    type="textarea"
                    :rows="5"
                    placeholder="请输入驳回原因"
                    v-model="storeRegisterRejectReason">
            </el-input>

            <span slot="footer" class="dialog-footer">
            <el-button @click="handleClose2">取 消</el-button>
            <el-button type="primary" @click="rejectRegister">确 定</el-button>
            </span>
        </el-dialog>

    </div>






    <script src="../js/storeRegister.js" type="text/javascript"></script>
</body>
</html>